#pragma once

CFT_DECLARE_CLASS_ENUM(HID_e, int,
    kPlayerMgr,
    kPlayer
);

CFT_DECLARE_CLASS_ENUM(DataSource_e, int,
    None,
    Login,
    World,
    Character
);

CFT_DECLARE_CLASS_ENUM(SocketFrom_e, int,
    kSkGG
);

CFT_DECLARE_CLASS_ENUM(ResponseCodes_e, int,
    RESPONSE_SUCCESS = 0x00,
    RESPONSE_FAILURE = 0x01,
    RESPONSE_CANCELLED = 0x02,
    RESPONSE_DISCONNECTED = 0x03,
    RESPONSE_FAILED_TO_CONNECT = 0x04,
    RESPONSE_CONNECTED = 0x05,
    RESPONSE_VERSION_MISMATCH = 0x06,

    CSTATUS_CONNECTING = 0x07,
    CSTATUS_NEGOTIATING_SECURITY = 0x08,
    CSTATUS_NEGOTIATION_COMPLETE = 0x09,
    CSTATUS_NEGOTIATION_FAILED = 0x0A,
    CSTATUS_AUTHENTICATING = 0x0B,

    AUTH_OK = 0x0C,
    AUTH_FAILED = 0x0D,
    AUTH_REJECT = 0x0E,
    AUTH_BAD_SERVER_PROOF = 0x0F,
    AUTH_UNAVAILABLE = 0x10,
    AUTH_SYSTEM_ERROR = 0x11,
    AUTH_BILLING_ERROR = 0x12,
    AUTH_BILLING_EXPIRED = 0x13,
    AUTH_VERSION_MISMATCH = 0x14,
    AUTH_UNKNOWN_ACCOUNT = 0x15,
    AUTH_INCORRECT_PASSWORD = 0x16,
    AUTH_SESSION_EXPIRED = 0x17,
    AUTH_SERVER_SHUTTING_DOWN = 0x18,
    AUTH_ALREADY_LOGGING_IN = 0x19,
    AUTH_LOGIN_SERVER_NOT_FOUND = 0x1A,
    AUTH_WAIT_QUEUE = 0x1B,
    AUTH_BANNED = 0x1C,
    AUTH_ALREADY_ONLINE = 0x1D,
    AUTH_NO_TIME = 0x1E,
    AUTH_DB_BUSY = 0x1F,
    AUTH_SUSPENDED = 0x20,
    AUTH_PARENTAL_CONTROL = 0x21,

    REALM_LIST_IN_PROGRESS = 0x22,
    REALM_LIST_SUCCESS = 0x23,
    REALM_LIST_FAILED = 0x24,
    REALM_LIST_INVALID = 0x25,
    REALM_LIST_REALM_NOT_FOUND = 0x26,

    ACCOUNT_CREATE_IN_PROGRESS = 0x27,
    ACCOUNT_CREATE_SUCCESS = 0x28,
    ACCOUNT_CREATE_FAILED = 0x29,

    CHAR_LIST_RETRIEVING = 0x2A,
    CHAR_LIST_RETRIEVED = 0x2B,
    CHAR_LIST_FAILED = 0x2C,

    CHAR_CREATE_IN_PROGRESS = 0x2D,
    CHAR_CREATE_SUCCESS = 0x2E,
    CHAR_CREATE_ERROR = 0x2F,
    CHAR_CREATE_FAILED = 0x30,
    CHAR_CREATE_NAME_IN_USE = 0x31,
    CHAR_CREATE_DISABLED = 0x32,
    CHAR_CREATE_PVP_TEAMS_VIOLATION = 0x33,
    CHAR_CREATE_SERVER_LIMIT = 0x34,
    CHAR_CREATE_ACCOUNT_LIMIT = 0x35,
    CHAR_CREATE_SERVER_QUEUE = 0x36,
    CHAR_CREATE_ONLY_EXISTING = 0x37,

    CHAR_DELETE_IN_PROGRESS = 0x38,
    CHAR_DELETE_SUCCESS = 0x39,
    CHAR_DELETE_FAILED = 0x3A,
    CHAR_DELETE_FAILED_LOCKED_FOR_TRANSFER = 0x3B,

    CHAR_LOGIN_IN_PROGRESS = 0x3C,
    CHAR_LOGIN_SUCCESS = 0x3D,
    CHAR_LOGIN_NO_WORLD = 0x3E,
    CHAR_LOGIN_DUPLICATE_CHARACTER = 0x3F,
    CHAR_LOGIN_NO_INSTANCES = 0x40,
    CHAR_LOGIN_FAILED = 0x41,
    CHAR_LOGIN_DISABLED = 0x42,
    CHAR_LOGIN_NO_CHARACTER = 0x43,
    CHAR_LOGIN_LOCKED_FOR_TRANSFER = 0x44,

    CHAR_NAME_NO_NAME = 0x45,
    CHAR_NAME_TOO_SHORT = 0x46,
    CHAR_NAME_TOO_LONG = 0x47,
    CHAR_NAME_INVALID_CHARACTER = 0x48,
    CHAR_NAME_MIXED_LANGUAGES = 0x49,
    CHAR_NAME_PROFANE = 0x4A,
    CHAR_NAME_RESERVED = 0x4B,
    CHAR_NAME_INVALID_APOSTROPHE = 0x4C,
    CHAR_NAME_MULTIPLE_APOSTROPHES = 0x4D,
    CHAR_NAME_THREE_CONSECUTIVE = 0x4E,
    CHAR_NAME_INVALID_SPACE = 0x4F,
    CHAR_NAME_CONSECUTIVE_SPACES = 0x50,
    CHAR_NAME_FAILURE = 0x51,
    CHAR_NAME_SUCCESS = 0x52,
);

CFT_DECLARE_CLASS_ENUM(PlayerFlags_e, int,
    PLAYER_FLAGS_NONE = 0x00000000,
    PLAYER_FLAGS_GROUP_LEADER = 0x00000001,
    PLAYER_FLAGS_AFK = 0x00000002,
    PLAYER_FLAGS_DND = 0x00000004,
    PLAYER_FLAGS_GM = 0x00000008,
    PLAYER_FLAGS_GHOST = 0x00000010,
    PLAYER_FLAGS_RESTING = 0x00000020,
    PLAYER_FLAGS_UNK7 = 0x00000040,       // admin?
    PLAYER_FLAGS_FFA_PVP = 0x00000080,
    PLAYER_FLAGS_CONTESTED_PVP = 0x00000100,       // Player has been involved in a PvP combat and will be attacked by contested guards
    PLAYER_FLAGS_IN_PVP = 0x00000200,
    PLAYER_FLAGS_HIDE_HELM = 0x00000400,
    PLAYER_FLAGS_HIDE_CLOAK = 0x00000800,
    PLAYER_FLAGS_PARTIAL_PLAY_TIME = 0x00001000,       // played long time
    PLAYER_FLAGS_NO_PLAY_TIME = 0x00002000,       // played too long time
    PLAYER_FLAGS_UNK15 = 0x00004000,
    PLAYER_FLAGS_UNK16 = 0x00008000,       // strange visual effect (2.0.1), looks like PLAYER_FLAGS_GHOST flag
    PLAYER_FLAGS_SANCTUARY = 0x00010000,       // player entered sanctuary
    PLAYER_FLAGS_TAXI_BENCHMARK = 0x00020000,       // taxi benchmark mode (on/off) (2.0.1)
    PLAYER_FLAGS_PVP_TIMER = 0x00040000,       // 3.0.2, pvp timer active (after you disable pvp manually)
);

#define MAX_PET_STABLES         2

// stored in character_pet.slot
CFT_DECLARE_CLASS_ENUM(PetSaveMode_e, int,
    PET_SAVE_AS_DELETED = -1,                        // not saved in fact
    PET_SAVE_AS_CURRENT = 0,                        // in current slot (with player)
    PET_SAVE_FIRST_STABLE_SLOT = 1,
    PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES,          // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
    PET_SAVE_NOT_IN_SLOT = 100,                      // for avoid conflict with stable size grow will use 100
    PET_SAVE_REAGENTS = 101                       // PET_SAVE_NOT_IN_SLOT with reagents return
);

CFT_DECLARE_CLASS_ENUM(CharacterFlags_e, unsigned int,
    CHARACTER_FLAG_NONE = 0x00000000,
    CHARACTER_FLAG_UNK1 = 0x00000001,
    CHARACTER_FLAG_UNK2 = 0x00000002,
    CHARACTER_LOCKED_FOR_TRANSFER = 0x00000004,
    CHARACTER_FLAG_UNK4 = 0x00000008,
    CHARACTER_FLAG_UNK5 = 0x00000010,
    CHARACTER_FLAG_UNK6 = 0x00000020,
    CHARACTER_FLAG_UNK7 = 0x00000040,
    CHARACTER_FLAG_UNK8 = 0x00000080,
    CHARACTER_FLAG_UNK9 = 0x00000100,
    CHARACTER_FLAG_UNK10 = 0x00000200,
    CHARACTER_FLAG_HIDE_HELM = 0x00000400,
    CHARACTER_FLAG_HIDE_CLOAK = 0x00000800,
    CHARACTER_FLAG_UNK13 = 0x00001000,
    CHARACTER_FLAG_GHOST = 0x00002000,
    CHARACTER_FLAG_RENAME = 0x00004000,
    CHARACTER_FLAG_UNK16 = 0x00008000,
    CHARACTER_FLAG_UNK17 = 0x00010000,
    CHARACTER_FLAG_UNK18 = 0x00020000,
    CHARACTER_FLAG_UNK19 = 0x00040000,
    CHARACTER_FLAG_UNK20 = 0x00080000,
    CHARACTER_FLAG_UNK21 = 0x00100000,
    CHARACTER_FLAG_UNK22 = 0x00200000,
    CHARACTER_FLAG_UNK23 = 0x00400000,
    CHARACTER_FLAG_UNK24 = 0x00800000,
    CHARACTER_FLAG_LOCKED_BY_BILLING = 0x01000000,
    CHARACTER_FLAG_DECLINED = 0x02000000,
    CHARACTER_FLAG_UNK27 = 0x04000000,
    CHARACTER_FLAG_UNK28 = 0x08000000,
    CHARACTER_FLAG_UNK29 = 0x10000000,
    CHARACTER_FLAG_UNK30 = 0x20000000,
    CHARACTER_FLAG_UNK31 = 0x40000000,
    CHARACTER_FLAG_UNK32 = 0x80000000
);

// 2^n values
CFT_DECLARE_CLASS_ENUM(AtLoginFlags_e, int,
    AT_LOGIN_NONE = 0x00,
    AT_LOGIN_RENAME = 0x01,
    AT_LOGIN_RESET_SPELLS = 0x02,
    AT_LOGIN_RESET_TALENTS = 0x04,
    // AT_LOGIN_CUSTOMIZE         = 0x08, -- used in post-3.x
    // AT_LOGIN_RESET_PET_TALENTS = 0x10, -- used in post-3.x
    AT_LOGIN_FIRST = 0x20,
);

CFT_DECLARE_CLASS_ENUM(HighGuid_e, int,
    HIGHGUID_ITEM = 0x4000,                       // blizz 4000
    HIGHGUID_CONTAINER = 0x4000,                       // blizz 4000
    HIGHGUID_PLAYER = 0x0000,                       // blizz 0000
    HIGHGUID_GAMEOBJECT = 0xF110,                       // blizz F110
    HIGHGUID_TRANSPORT = 0xF120,                       // blizz F120 (for GAMEOBJECT_TYPE_TRANSPORT)
    HIGHGUID_UNIT = 0xF130,                       // blizz F130
    HIGHGUID_PET = 0xF140,                       // blizz F140
    HIGHGUID_DYNAMICOBJECT = 0xF100,                       // blizz F100
    HIGHGUID_CORPSE = 0xF101,                       // blizz F100
    HIGHGUID_MO_TRANSPORT = 0x1FC0,                       // blizz 1FC0 (for GAMEOBJECT_TYPE_MO_TRANSPORT)
);

CFT_DECLARE_CLASS_ENUM(EquipmentSlots_, unsigned int, // 19 slots
    EQUIPMENT_SLOT_START = 0,
    EQUIPMENT_SLOT_HEAD = 0,
    EQUIPMENT_SLOT_NECK = 1,
    EQUIPMENT_SLOT_SHOULDERS = 2,
    EQUIPMENT_SLOT_BODY = 3,
    EQUIPMENT_SLOT_CHEST = 4,
    EQUIPMENT_SLOT_WAIST = 5,
    EQUIPMENT_SLOT_LEGS = 6,
    EQUIPMENT_SLOT_FEET = 7,
    EQUIPMENT_SLOT_WRISTS = 8,
    EQUIPMENT_SLOT_HANDS = 9,
    EQUIPMENT_SLOT_FINGER1 = 10,
    EQUIPMENT_SLOT_FINGER2 = 11,
    EQUIPMENT_SLOT_TRINKET1 = 12,
    EQUIPMENT_SLOT_TRINKET2 = 13,
    EQUIPMENT_SLOT_BACK = 14,
    EQUIPMENT_SLOT_MAINHAND = 15,
    EQUIPMENT_SLOT_OFFHAND = 16,
    EQUIPMENT_SLOT_RANGED = 17,
    EQUIPMENT_SLOT_TABARD = 18,
    EQUIPMENT_SLOT_END = 19
);

enum FactionMasks
{
    FACTION_MASK_PLAYER = 1,                              // any player
    FACTION_MASK_ALLIANCE = 2,                              // player or creature from alliance team
    FACTION_MASK_HORDE = 4,                              // player or creature from horde team
    FACTION_MASK_MONSTER = 8                               // aggressive creature from monster team
    // if none flags set then non-aggressive creature
};

enum FactionTemplateFlags
{
    FACTION_TEMPLATE_FLAG_PVP = 0x00000800,   // flagged for PvP
    FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000,   // faction will attack players that were involved in PvP combats
};

enum MapTypes                                               // Lua_IsInInstance
{
    MAP_COMMON = 0,                                // none
    MAP_INSTANCE = 1,                                // party
    MAP_RAID = 2,                                // raid
    MAP_BATTLEGROUND = 3,                                // pvp
};

enum SpellEffectIndex
{
    EFFECT_INDEX_0 = 0, ///< The first spell effect
    EFFECT_INDEX_1 = 1, ///< The second spell effect
    EFFECT_INDEX_2 = 2  ///< The third spell effect
};

enum SpellFamily
{
    SPELLFAMILY_GENERIC = 0,
    SPELLFAMILY_ENVIRONMENT = 1,                            // events, holidays, mostly aura related spells
    // 2 - unused
    SPELLFAMILY_MAGE = 3,
    SPELLFAMILY_WARRIOR = 4,
    SPELLFAMILY_WARLOCK = 5,
    SPELLFAMILY_PRIEST = 6,
    SPELLFAMILY_DRUID = 7,
    SPELLFAMILY_ROGUE = 8,
    SPELLFAMILY_HUNTER = 9,
    SPELLFAMILY_PALADIN = 10,
    SPELLFAMILY_SHAMAN = 11,
    // 12 - unused
    SPELLFAMILY_POTION = 13,
};

enum SpellAttributes
{
    SPELL_ATTR_UNK0 = 0x00000001,            // 0
    SPELL_ATTR_RANGED = 0x00000002,            // 1 All ranged abilites have this flag
    SPELL_ATTR_ON_NEXT_SWING_1 = 0x00000004,            // 2 on next swing
    SPELL_ATTR_UNK3 = 0x00000008,            // 3 not set in 2.4.2
    SPELL_ATTR_ABILITY = 0x00000010,            // 4 Displays ability instead of spell clientside
    SPELL_ATTR_TRADESPELL = 0x00000020,            // 5 trade spells, will be added by client to a sublist of profession spell
    SPELL_ATTR_PASSIVE = 0x00000040,            // 6 Passive spell
    SPELL_ATTR_HIDDEN_CLIENTSIDE = 0x00000080,            // 7 Spells with this attribute are not visible in spellbook or aura bar TODO: check usage
    SPELL_ATTR_HIDE_IN_COMBAT_LOG = 0x00000100,            // 8 hide created item in tooltip (for effect=24) TODO: implement it
    SPELL_ATTR_TARGET_MAINHAND_ITEM = 0x00000200,            // 9 Client automatically selects item from mainhand slot as a cast target TODO: Implement
    SPELL_ATTR_ON_NEXT_SWING_2 = 0x00000400,            // 10 on next swing 2
    SPELL_ATTR_UNK11 = 0x00000800,            // 11
    SPELL_ATTR_DAYTIME_ONLY = 0x00001000,            // 12 only useable at daytime, not set in 2.4.2
    SPELL_ATTR_NIGHT_ONLY = 0x00002000,            // 13 only useable at night, not set in 2.4.2
    SPELL_ATTR_INDOORS_ONLY = 0x00004000,            // 14 only useable indoors, not set in 2.4.2
    SPELL_ATTR_OUTDOORS_ONLY = 0x00008000,            // 15 Only useable outdoors.
    SPELL_ATTR_NOT_SHAPESHIFT = 0x00010000,            // 16 Not while shapeshifted
    SPELL_ATTR_ONLY_STEALTHED = 0x00020000,            // 17 Must be in stealth
    SPELL_ATTR_DONT_AFFECT_SHEATH_STATE = 0x00040000,            // 18 client won't hide unit weapons in sheath on cast/channel TODO: Implement
    SPELL_ATTR_LEVEL_DAMAGE_CALCULATION = 0x00080000,            // 19 spelldamage depends on caster level
    SPELL_ATTR_STOP_ATTACK_TARGET = 0x00100000,            // 20 Stop attack after use this spell (and not begin attack if use)
    SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000,            // 21 Can not be dodged/parried/blocked
    SPELL_ATTR_SET_TRACKING_TARGET = 0x00400000,            // 22 SetTrackingTarget
    SPELL_ATTR_CASTABLE_WHILE_DEAD = 0x00800000,            // 23 castable while dead - TODO: Implement
    SPELL_ATTR_CASTABLE_WHILE_MOUNTED = 0x01000000,            // 24 castable while mounted
    SPELL_ATTR_DISABLED_WHILE_ACTIVE = 0x02000000,            // 25 Activate and start cooldown after aura fade or remove summoned creature or go
    SPELL_ATTR_AURA_IS_DEBUFF = 0x04000000,            // 26
    SPELL_ATTR_CASTABLE_WHILE_SITTING = 0x08000000,            // 27 castable while sitting
    SPELL_ATTR_CANT_USED_IN_COMBAT = 0x10000000,            // 28 Can not be used in combat
    SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY = 0x20000000,            // 29 unaffected by invulnerability (hmm possible not...)
    SPELL_ATTR_HEARTBEAT_RESIST_CHECK = 0x40000000,            // 30 TC 335: random chance the effect will end (subjected to the hearbeat resist)
    SPELL_ATTR_CANT_CANCEL = 0x80000000             // 31 positive aura can't be canceled
};

enum SpellAttributesEx
{
    SPELL_ATTR_EX_UNK0 = 0x00000001,            // 0
    SPELL_ATTR_EX_DRAIN_ALL_POWER = 0x00000002,            // 1 use all power (Only paladin Lay of Hands and Bunyanize)
    SPELL_ATTR_EX_CHANNELED_1 = 0x00000004,            // 2 channeled 1
    SPELL_ATTR_EX_CANT_BE_REDIRECTED = 0x00000008,            // 3
    SPELL_ATTR_EX_UNK4 = 0x00000010,            // 4
    SPELL_ATTR_EX_NOT_BREAK_STEALTH = 0x00000020,            // 5 Not break stealth
    SPELL_ATTR_EX_CHANNELED_2 = 0x00000040,            // 6 channeled 2
    SPELL_ATTR_EX_CANT_BE_REFLECTED = 0x00000080,            // 7
    SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET = 0x00000100,            // 8 Spell req target not to be in combat state
    SPELL_ATTR_EX_FACING_TARGET = 0x00000200,            // 9 TODO: CONFIRM!
    SPELL_ATTR_EX_NO_THREAT = 0x00000400,            // 10 no generates threat on cast 100%
    SPELL_ATTR_EX_UNK11 = 0x00000800,            // 11
    SPELL_ATTR_EX_IS_PICKPOCKET = 0x00001000,            // 12
    SPELL_ATTR_EX_FARSIGHT = 0x00002000,            // 13 related to farsight
    SPELL_ATTR_EX_CHANNEL_TRACK_TARGET = 0x00004000,            // 14
    SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY = 0x00008000,            // 15 remove auras on immunity
    SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000,            // 16 unaffected by school immunity
    SPELL_ATTR_EX_UNAUTOCASTABLE_BY_CHARMED = 0x00020000,            // 17 TODO: Investigate more: SPELL_ATTR_EX_PLAYER_CANT_CAST_CHARMED, likely related to MC ,for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells
    SPELL_ATTR_EX_UNK18 = 0x00040000,            // 18
    SPELL_ATTR_EX_CANT_TARGET_SELF = 0x00080000,            // 19 spells that exclude the caster
    SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000,            // 20 Req combo points on target
    SPELL_ATTR_EX_UNK21 = 0x00200000,            // 21
    SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000,            // 22 Use combo points (in 4.x not required combo point target selected)
    SPELL_ATTR_EX_UNK23 = 0x00800000,            // 23
    SPELL_ATTR_EX_UNK24 = 0x01000000,            // 24 Req fishing pole??
    SPELL_ATTR_EX_UNK25 = 0x02000000,            // 25 not set in 2.4.2
    SPELL_ATTR_EX_UNK26 = 0x04000000,            // 26
    SPELL_ATTR_EX_REFUND_POWER = 0x08000000,            // 27 All these spells refund power on parry or deflect
    SPELL_ATTR_EX_DONT_DISPLAY_IN_AURA_BAR = 0x10000000,            // 28
    SPELL_ATTR_EX_CHANNEL_DISPLAY_SPELL_NAME = 0x20000000,            // 29
    SPELL_ATTR_EX_ENABLE_AT_DODGE = 0x40000000,            // 30 overpower
    SPELL_ATTR_EX_UNK31 = 0x80000000,            // 31
};

enum SpellAttributesEx2
{
    SPELL_ATTR_EX2_CAN_TARGET_DEAD = 0x00000001,            // 0 can target dead unit or corpse
    SPELL_ATTR_EX2_UNK1 = 0x00000002,            // 1
    SPELL_ATTR_EX2_IGNORE_LOS = 0x00000004,            // 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3)
    SPELL_ATTR_EX2_UNK3 = 0x00000008,            // 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3)
    SPELL_ATTR_EX2_DISPLAY_IN_STANCE_BAR = 0x00000010,            // 4
    SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x00000020,            // 5
    SPELL_ATTR_EX2_CANT_TARGET_TAPPED = 0x00000040,            // 6 only usable on tabbed by yourself
    SPELL_ATTR_EX2_UNK7 = 0x00000080,            // 7
    SPELL_ATTR_EX2_UNK8 = 0x00000100,            // 8 not set in 2.4.2
    SPELL_ATTR_EX2_UNK9 = 0x00000200,            // 9
    SPELL_ATTR_EX2_UNK10 = 0x00000400,            // 10
    SPELL_ATTR_EX2_HEALTH_FUNNEL = 0x00000800,            // 11
    SPELL_ATTR_EX2_UNK12 = 0x00001000,            // 12
    SPELL_ATTR_EX2_UNK13 = 0x00002000,            // 13
    SPELL_ATTR_EX2_UNK14 = 0x00004000,            // 14
    SPELL_ATTR_EX2_UNK15 = 0x00008000,            // 15 not set in 2.4.2
    SPELL_ATTR_EX2_TAME_BEAST = 0x00010000,            // 16
    SPELL_ATTR_EX2_NOT_RESET_AUTO_ACTIONS = 0x00020000,            // 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?)
    SPELL_ATTR_EX2_REQ_DEAD_PET = 0x00040000,            // 18 Only Revive pet - possible req dead pet
    SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT = 0x00080000,            // 19 does not necessary need shapeshift (pre-3.x not have passive spells with this attribute)
    SPELL_ATTR_EX2_FACING_TARGETS_BACK = 0x00100000,            // 20 TODO: CONFIRM!
    SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD = 0x00200000,            // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure!
    SPELL_ATTR_EX2_UNK22 = 0x00400000,            // 22
    SPELL_ATTR_EX2_IS_ARCANE_CONCENTRATION = 0x00800000,            // 23 Only mage Arcane Concentration have this flag
    SPELL_ATTR_EX2_UNK24 = 0x01000000,            // 24
    SPELL_ATTR_EX2_UNK25 = 0x02000000,            // 25
    SPELL_ATTR_EX2_UNK26 = 0x04000000,            // 26 unaffected by school immunity
    SPELL_ATTR_EX2_UNK27 = 0x08000000,            // 27
    SPELL_ATTR_EX2_UNK28 = 0x10000000,            // 28 no breaks stealth if it fails??
    SPELL_ATTR_EX2_CANT_CRIT = 0x20000000,            // 29 Spell can't crit
    SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER_PROC = 0x40000000,            // 30
    SPELL_ATTR_EX2_FOOD_BUFF = 0x80000000,            // 31 Food or Drink Buff (like Well Fed)
};

enum SpellAttributesEx3
{
    SPELL_ATTR_EX3_OUT_OF_COMBAT_ATTACK = 0x00000001,            // 0 Spell landed counts as hostile action against enemy even if it doesn't trigger combat state, propagates PvP flags
    SPELL_ATTR_EX3_UNK1 = 0x00000002,            // 1
    SPELL_ATTR_EX3_UNK2 = 0x00000004,            // 2
    SPELL_ATTR_EX3_BLOCKABLE_SPELL = 0x00000008,            // 3
    SPELL_ATTR_EX3_IGNORE_RESURRECTION_TIMER = 0x00000010,            // 4 Druid Rebirth only this spell have this flag
    SPELL_ATTR_EX3_UNK5 = 0x00000020,            // 5
    SPELL_ATTR_EX3_UNK6 = 0x00000040,            // 6
    SPELL_ATTR_EX3_STACK_FOR_DIFF_CASTERS = 0x00000080,            // 7 create a separate (de)buff stack for each caster
    SPELL_ATTR_EX3_TARGET_ONLY_PLAYER = 0x00000100,            // 8 Can target only player
    SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_SPECIAL = 0x00000200,            // 9 Can only proc auras with SPELL_ATTR_EX3_CAN_PROC_FROM_TRIGGERED_SPECIAL
    SPELL_ATTR_EX3_MAIN_HAND = 0x00000400,            // 10 Main hand weapon required
    SPELL_ATTR_EX3_BATTLEGROUND = 0x00000800,            // 11 Can casted only on battleground
    SPELL_ATTR_EX3_CAST_ON_DEAD = 0x00001000,            // 12 target is a dead player (not every spell has this flag)
    SPELL_ATTR_EX3_DONT_DISPLAY_CHANNEL_BAR = 0x00002000,            // 13
    SPELL_ATTR_EX3_IS_HONORLESS_TARGET = 0x00004000,            // 14 "Honorless Target" only this spells have this flag
    SPELL_ATTR_EX3_RANGED_ATTACK = 0x00008000,            // 15 Auto Shoot, Shoot, Throw,  - this is autoshot flag
    SPELL_ATTR_EX3_CANT_TRIGGER_PROC = 0x00010000,            // 16 confirmed by patchnotes
    SPELL_ATTR_EX3_NO_INITIAL_AGGRO = 0x00020000,            // 17 Causes no aggro if not missed
    SPELL_ATTR_EX3_CANT_MISS = 0x00040000,            // 18 Spell should always hit its target
    SPELL_ATTR_EX3_UNK19 = 0x00080000,            // 19
    SPELL_ATTR_EX3_DEATH_PERSISTENT = 0x00100000,            // 20 Death persistent spells
    SPELL_ATTR_EX3_UNK21 = 0x00200000,            // 21
    SPELL_ATTR_EX3_REQ_WAND = 0x00400000,            // 22 Req wand
    SPELL_ATTR_EX3_UNK23 = 0x00800000,            // 23
    SPELL_ATTR_EX3_REQ_OFFHAND = 0x01000000,            // 24 Req offhand weapon
    SPELL_ATTR_EX3_UNK25 = 0x02000000,            // 25 no cause spell pushback ?
    SPELL_ATTR_EX3_CAN_PROC_FROM_TRIGGERED_SPECIAL = 0x04000000,            // 26 Auras with this attribute can proc off SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_SPECIAL
    SPELL_ATTR_EX3_DRAIN_SOUL = 0x08000000,            // 27
    SPELL_ATTR_EX3_UNK28 = 0x10000000,            // 28 always cast ok ? (requires more research)
    SPELL_ATTR_EX3_NO_DONE_BONUS = 0x20000000,            // 29 Resistances should still affect damage
    SPELL_ATTR_EX3_DONT_DISPLAY_RANGE = 0x40000000,            // 30
    SPELL_ATTR_EX3_UNK31 = 0x80000000             // 31
};

enum SpellAttributesEx4
{
    SPELL_ATTR_EX4_IGNORE_RESISTANCES = 0x00000001,            // 0
    SPELL_ATTR_EX4_PROC_ONLY_ON_CASTER = 0x00000002,            // 1  Only proc on self-cast
    SPELL_ATTR_EX4_UNK2 = 0x00000004,            // 2
    SPELL_ATTR_EX4_UNK3 = 0x00000008,            // 3
    SPELL_ATTR_EX4_UNK4 = 0x00000010,            // 4 This will no longer cause guards to attack on use??
    SPELL_ATTR_EX4_UNK5 = 0x00000020,            // 5
    SPELL_ATTR_EX4_NOT_STEALABLE = 0x00000040,            // 6 although such auras might be dispellable, they can not be stolen
    SPELL_ATTR_EX4_CAN_CAST_WHILE_CASTING = 0x00000080,            // 7 In theory, can use this spell while another is channeled/cast/autocast
    SPELL_ATTR_EX4_STACK_DOT_MODIFIER = 0x00000100,            // 8 no effect on non DoTs?
    SPELL_ATTR_EX4_TRIGGER_ACTIVATE = 0x00000200,            // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other)
    SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST = 0x00000400,            // 10 Rogue Shiv have this flag
    SPELL_ATTR_EX4_UNK11 = 0x00000800,            // 11
    SPELL_ATTR_EX4_UNK12 = 0x00001000,            // 12
    SPELL_ATTR_EX4_UNK13 = 0x00002000,            // 13
    SPELL_ATTR_EX4_DAMAGE_DOESNT_BREAK_AURAS = 0x00004000,            // 14
    SPELL_ATTR_EX4_UNK15 = 0x00008000,            // 15
    SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA = 0x00010000,            // 16 not usable in arena
    SPELL_ATTR_EX4_USABLE_IN_ARENA = 0x00020000,            // 17 usable in arena
    SPELL_ATTR_EX4_UNK18 = 0x00040000,            // 18
    SPELL_ATTR_EX4_UNK19 = 0x00080000,            // 19
    SPELL_ATTR_EX4_NOT_CHECK_SELFCAST_POWER = 0x00100000,            // 20 do not give "more powerful spell" error message
    SPELL_ATTR_EX4_UNK21 = 0x00200000,            // 21
    SPELL_ATTR_EX4_UNK22 = 0x00400000,            // 22
    SPELL_ATTR_EX4_UNK23 = 0x00800000,            // 23
    SPELL_ATTR_EX4_UNK24 = 0x01000000,            // 24
    SPELL_ATTR_EX4_IS_PET_SCALING = 0x02000000,            // 25 pet scaling auras
    SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND = 0x04000000,            // 26 Can only be used in Outland.
    SPELL_ATTR_EX4_UNK27 = 0x08000000,            // 27
    SPELL_ATTR_EX4_UNK28 = 0x10000000,            // 28
    SPELL_ATTR_EX4_UNK29 = 0x20000000,            // 29
    SPELL_ATTR_EX4_UNK30 = 0x40000000,            // 30
    SPELL_ATTR_EX4_UNK31 = 0x80000000             // 31
};

enum SpellEffects
{
    SPELL_EFFECT_NONE = 0,
    SPELL_EFFECT_INSTAKILL = 1,
    SPELL_EFFECT_SCHOOL_DAMAGE = 2,
    SPELL_EFFECT_DUMMY = 3,
    SPELL_EFFECT_PORTAL_TELEPORT = 4,
    SPELL_EFFECT_TELEPORT_UNITS = 5,
    SPELL_EFFECT_APPLY_AURA = 6,
    SPELL_EFFECT_ENVIRONMENTAL_DAMAGE = 7,
    SPELL_EFFECT_POWER_DRAIN = 8,
    SPELL_EFFECT_HEALTH_LEECH = 9,
    SPELL_EFFECT_HEAL = 10,
    SPELL_EFFECT_BIND = 11,
    SPELL_EFFECT_PORTAL = 12,
    SPELL_EFFECT_RITUAL_BASE = 13,
    SPELL_EFFECT_RITUAL_SPECIALIZE = 14,
    SPELL_EFFECT_RITUAL_ACTIVATE_PORTAL = 15,
    SPELL_EFFECT_QUEST_COMPLETE = 16,
    SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL = 17,
    SPELL_EFFECT_RESURRECT = 18,
    SPELL_EFFECT_ADD_EXTRA_ATTACKS = 19,
    SPELL_EFFECT_DODGE = 20,
    SPELL_EFFECT_EVADE = 21,
    SPELL_EFFECT_PARRY = 22,
    SPELL_EFFECT_BLOCK = 23,
    SPELL_EFFECT_CREATE_ITEM = 24,
    SPELL_EFFECT_WEAPON = 25,
    SPELL_EFFECT_DEFENSE = 26,
    SPELL_EFFECT_PERSISTENT_AREA_AURA = 27,
    SPELL_EFFECT_SUMMON = 28,
    SPELL_EFFECT_LEAP = 29,
    SPELL_EFFECT_ENERGIZE = 30,
    SPELL_EFFECT_WEAPON_PERCENT_DAMAGE = 31,
    SPELL_EFFECT_TRIGGER_MISSILE = 32,
    SPELL_EFFECT_OPEN_LOCK = 33,
    SPELL_EFFECT_SUMMON_CHANGE_ITEM = 34,
    SPELL_EFFECT_APPLY_AREA_AURA_PARTY = 35,
    SPELL_EFFECT_LEARN_SPELL = 36,
    SPELL_EFFECT_SPELL_DEFENSE = 37,
    SPELL_EFFECT_DISPEL = 38,
    SPELL_EFFECT_LANGUAGE = 39,
    SPELL_EFFECT_DUAL_WIELD = 40,
    SPELL_EFFECT_SUMMON_WILD = 41,
    SPELL_EFFECT_SUMMON_GUARDIAN = 42,
    SPELL_EFFECT_TELEPORT_UNITS_FACE_CASTER = 43,
    SPELL_EFFECT_SKILL_STEP = 44,
    SPELL_EFFECT_ADD_HONOR = 45,
    SPELL_EFFECT_SPAWN = 46,
    SPELL_EFFECT_TRADE_SKILL = 47,
    SPELL_EFFECT_STEALTH = 48,
    SPELL_EFFECT_DETECT = 49,
    SPELL_EFFECT_TRANS_DOOR = 50,
    SPELL_EFFECT_FORCE_CRITICAL_HIT = 51,
    SPELL_EFFECT_GUARANTEE_HIT = 52,
    SPELL_EFFECT_ENCHANT_ITEM = 53,
    SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY = 54,
    SPELL_EFFECT_TAMECREATURE = 55,
    SPELL_EFFECT_SUMMON_PET = 56,
    SPELL_EFFECT_LEARN_PET_SPELL = 57,
    SPELL_EFFECT_WEAPON_DAMAGE = 58,
    SPELL_EFFECT_OPEN_LOCK_ITEM = 59,
    SPELL_EFFECT_PROFICIENCY = 60,
    SPELL_EFFECT_SEND_EVENT = 61,
    SPELL_EFFECT_POWER_BURN = 62,
    SPELL_EFFECT_THREAT = 63,
    SPELL_EFFECT_TRIGGER_SPELL = 64,
    SPELL_EFFECT_HEALTH_FUNNEL = 65,
    SPELL_EFFECT_POWER_FUNNEL = 66,
    SPELL_EFFECT_HEAL_MAX_HEALTH = 67,
    SPELL_EFFECT_INTERRUPT_CAST = 68,
    SPELL_EFFECT_DISTRACT = 69,
    SPELL_EFFECT_PULL = 70,
    SPELL_EFFECT_PICKPOCKET = 71,
    SPELL_EFFECT_ADD_FARSIGHT = 72,
    SPELL_EFFECT_SUMMON_POSSESSED = 73,
    SPELL_EFFECT_SUMMON_TOTEM = 74,
    SPELL_EFFECT_HEAL_MECHANICAL = 75,
    SPELL_EFFECT_SUMMON_OBJECT_WILD = 76,
    SPELL_EFFECT_SCRIPT_EFFECT = 77,
    SPELL_EFFECT_ATTACK = 78,
    SPELL_EFFECT_SANCTUARY = 79,
    SPELL_EFFECT_ADD_COMBO_POINTS = 80,
    SPELL_EFFECT_CREATE_HOUSE = 81,
    SPELL_EFFECT_BIND_SIGHT = 82,
    SPELL_EFFECT_DUEL = 83,
    SPELL_EFFECT_STUCK = 84,
    SPELL_EFFECT_SUMMON_PLAYER = 85,
    SPELL_EFFECT_ACTIVATE_OBJECT = 86,
    SPELL_EFFECT_SUMMON_TOTEM_SLOT1 = 87,
    SPELL_EFFECT_SUMMON_TOTEM_SLOT2 = 88,
    SPELL_EFFECT_SUMMON_TOTEM_SLOT3 = 89,
    SPELL_EFFECT_SUMMON_TOTEM_SLOT4 = 90,
    SPELL_EFFECT_THREAT_ALL = 91,
    SPELL_EFFECT_ENCHANT_HELD_ITEM = 92,
    SPELL_EFFECT_SUMMON_PHANTASM = 93,
    SPELL_EFFECT_SELF_RESURRECT = 94,
    SPELL_EFFECT_SKINNING = 95,
    SPELL_EFFECT_CHARGE = 96,
    SPELL_EFFECT_SUMMON_CRITTER = 97,
    SPELL_EFFECT_KNOCK_BACK = 98,
    SPELL_EFFECT_DISENCHANT = 99,
    SPELL_EFFECT_INEBRIATE = 100,
    SPELL_EFFECT_FEED_PET = 101,
    SPELL_EFFECT_DISMISS_PET = 102,
    SPELL_EFFECT_REPUTATION = 103,
    SPELL_EFFECT_SUMMON_OBJECT_SLOT1 = 104,
    SPELL_EFFECT_SUMMON_OBJECT_SLOT2 = 105,
    SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 106,
    SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 107,
    SPELL_EFFECT_DISPEL_MECHANIC = 108,
    SPELL_EFFECT_SUMMON_DEAD_PET = 109,
    SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110,
    SPELL_EFFECT_DURABILITY_DAMAGE = 111,
    SPELL_EFFECT_SUMMON_DEMON = 112,
    SPELL_EFFECT_RESURRECT_NEW = 113,
    SPELL_EFFECT_ATTACK_ME = 114,
    SPELL_EFFECT_DURABILITY_DAMAGE_PCT = 115,
    SPELL_EFFECT_SKIN_PLAYER_CORPSE = 116,
    SPELL_EFFECT_SPIRIT_HEAL = 117,
    SPELL_EFFECT_SKILL = 118,
    SPELL_EFFECT_APPLY_AREA_AURA_PET = 119,
    SPELL_EFFECT_TELEPORT_GRAVEYARD = 120,
    SPELL_EFFECT_NORMALIZED_WEAPON_DMG = 121,
    SPELL_EFFECT_122 = 122,
    SPELL_EFFECT_SEND_TAXI = 123,
    SPELL_EFFECT_PLAYER_PULL = 124,
    SPELL_EFFECT_MODIFY_THREAT_PERCENT = 125,
    SPELL_EFFECT_126 = 126,
    SPELL_EFFECT_127 = 127,
    SPELL_EFFECT_128 = 128,
    SPELL_EFFECT_129 = 129,
    TOTAL_SPELL_EFFECTS = 130
};

enum TimeConstants
{
    MINUTE = 60,
    HOUR = MINUTE * 60,
    DAY = HOUR * 24,
    WEEK = DAY * 7,
    MONTH = DAY * 30,
    YEAR = MONTH * 12,
    IN_MILLISECONDS = 1000
};

// checked for 1.12.1
enum ObjectUpdateFlags
{
    UPDATEFLAG_NONE = 0x0000,
    UPDATEFLAG_SELF = 0x0001,
    UPDATEFLAG_TRANSPORT = 0x0002,
    UPDATEFLAG_FULLGUID = 0x0004,
    UPDATEFLAG_HIGHGUID = 0x0008,
    UPDATEFLAG_ALL = 0x0010,
    UPDATEFLAG_LIVING = 0x0020,
    UPDATEFLAG_HAS_POSITION = 0x0040
};

enum WeatherType
{
    WEATHER_TYPE_FINE = 0,
    WEATHER_TYPE_RAIN = 1,
    WEATHER_TYPE_SNOW = 2,
    WEATHER_TYPE_STORM = 3
};

enum TeleportLocation
{
    TELEPORT_LOCATION_HOMEBIND = 0,
    TELEPORT_LOCATION_BG_ENTRY_POINT = 1,
};

enum Language
{
    LANG_UNIVERSAL = 0,
    LANG_ORCISH = 1,
    LANG_DARNASSIAN = 2,
    LANG_TAURAHE = 3,
    LANG_DWARVISH = 6,
    LANG_COMMON = 7,
    LANG_DEMONIC = 8,
    LANG_TITAN = 9,
    LANG_THALASSIAN = 10,
    LANG_DRACONIC = 11,
    LANG_KALIMAG = 12,
    LANG_GNOMISH = 13,
    LANG_TROLL = 14,
    LANG_GUTTERSPEAK = 33,
    LANG_ADDON = 0xFFFFFFFF                        // used by addons, in 2.4.0 not exit, replaced by messagetype?
};

enum LocaleConstant
{
    LOCALE_enUS = 0,                                        // also enGB
    LOCALE_koKR = 1,
    LOCALE_frFR = 2,
    LOCALE_deDE = 3,
    LOCALE_zhCN = 4,
    LOCALE_zhTW = 5,
    LOCALE_esES = 6,
    LOCALE_esMX = 7,

};

enum MovementGeneratorType
{
    IDLE_MOTION_TYPE = 0,                    // IdleMovementGenerator.h
    RANDOM_MOTION_TYPE = 1,                    // RandomMovementGenerator.h
    WAYPOINT_MOTION_TYPE = 2,                    // WaypointMovementGenerator.h
    MAX_DB_MOTION_TYPE = 3,                    // *** this and below motion types can't be set in DB.

    CONFUSED_MOTION_TYPE = 4,                    // ConfusedMovementGenerator.h
    CHASE_MOTION_TYPE = 5,                    // TargetedMovementGenerator.h
    HOME_MOTION_TYPE = 6,                    // HomeMovementGenerator.h
    FLIGHT_MOTION_TYPE = 7,                    // WaypointMovementGenerator.h
    POINT_MOTION_TYPE = 8,                    // PointMovementGenerator.h
    FLEEING_MOTION_TYPE = 9,                    // FleeingMovementGenerator.h
    DISTRACT_MOTION_TYPE = 10,                   // IdleMovementGenerator.h
    ASSISTANCE_MOTION_TYPE = 11,                   // PointMovementGenerator.h (first part of flee for assistance)
    ASSISTANCE_DISTRACT_MOTION_TYPE = 12,                   // IdleMovementGenerator.h (second part of flee for assistance)
    TIMED_FLEEING_MOTION_TYPE = 13,                   // FleeingMovementGenerator.h (alt.second part of flee for assistance)
    FOLLOW_MOTION_TYPE = 14,                   // TargetedMovementGenerator.h
    EFFECT_MOTION_TYPE = 15,

    EXTERNAL_WAYPOINT_MOVE = 256,                  // Only used in CreatureAI::MovementInform when a waypoint is reached. The pathId >= 0 is added as additonal value
    EXTERNAL_WAYPOINT_MOVE_START = 512,                  // Only used in CreatureAI::MovementInform when a waypoint is started. The pathId >= 0 is added as additional value
    EXTERNAL_WAYPOINT_FINISHED_LAST = 1024,                 // Only used in CreatureAI::MovementInform when the waittime of the last wp is finished The pathId >= 0 is added as additional value
};

enum GameobjectTypes
{
    GAMEOBJECT_TYPE_DOOR = 0,
    GAMEOBJECT_TYPE_BUTTON = 1,
    GAMEOBJECT_TYPE_QUESTGIVER = 2,
    GAMEOBJECT_TYPE_CHEST = 3,
    GAMEOBJECT_TYPE_BINDER = 4,
    GAMEOBJECT_TYPE_GENERIC = 5,
    GAMEOBJECT_TYPE_TRAP = 6,
    GAMEOBJECT_TYPE_CHAIR = 7,
    GAMEOBJECT_TYPE_SPELL_FOCUS = 8,
    GAMEOBJECT_TYPE_TEXT = 9,
    GAMEOBJECT_TYPE_GOOBER = 10,
    GAMEOBJECT_TYPE_TRANSPORT = 11,
    GAMEOBJECT_TYPE_AREADAMAGE = 12,
    GAMEOBJECT_TYPE_CAMERA = 13,
    GAMEOBJECT_TYPE_MAP_OBJECT = 14,
    GAMEOBJECT_TYPE_MO_TRANSPORT = 15,
    GAMEOBJECT_TYPE_DUEL_ARBITER = 16,
    GAMEOBJECT_TYPE_FISHINGNODE = 17,
    GAMEOBJECT_TYPE_SUMMONING_RITUAL = 18,
    GAMEOBJECT_TYPE_MAILBOX = 19,
    GAMEOBJECT_TYPE_AUCTIONHOUSE = 20,
    GAMEOBJECT_TYPE_GUARDPOST = 21,
    GAMEOBJECT_TYPE_SPELLCASTER = 22,
    GAMEOBJECT_TYPE_MEETINGSTONE = 23,
    GAMEOBJECT_TYPE_FLAGSTAND = 24,
    GAMEOBJECT_TYPE_FISHINGHOLE = 25,
    GAMEOBJECT_TYPE_FLAGDROP = 26,
    GAMEOBJECT_TYPE_MINI_GAME = 27,
    GAMEOBJECT_TYPE_LOTTERY_KIOSK = 28,
    GAMEOBJECT_TYPE_CAPTURE_POINT = 29,
    GAMEOBJECT_TYPE_AURA_GENERATOR = 30,
    GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING = 14,    // Not Implemented in Zero
};

enum InstanceResetMethod
{
    INSTANCE_RESET_ALL,
    INSTANCE_RESET_GLOBAL,
    INSTANCE_RESET_GROUP_DISBAND,
    INSTANCE_RESET_GROUP_JOIN,
    INSTANCE_RESET_RESPAWN_DELAY                            // called from reset scheduler for request reset at map unload when map loaded at reset attempt for normal dungeon
};

enum MMCleanFlag
{
    MMCF_NONE = 0,
    MMCF_UPDATE = 1,                                        // Clear or Expire called from update
    MMCF_RESET = 2                                         // Flag if need top()->Reset()
};

// Forward class definitions
namespace battle::object
{
    struct WorldLocation;
    class Object;
    class Corpse;
    class Creature;
    class DynamicObject;
    class GameObject;
    class Pet;
    class Player;
    class Camera;
    class WorldObject;
    class Transport;
    class Unit;
}

enum ObjectUpdateType
{
    UPDATETYPE_VALUES = 0,
    UPDATETYPE_MOVEMENT = 1,
    UPDATETYPE_CREATE_OBJECT = 2,
    UPDATETYPE_CREATE_OBJECT2 = 3,
    UPDATETYPE_OUT_OF_RANGE_OBJECTS = 4,
    UPDATETYPE_NEAR_OBJECTS = 5
};

enum PlayerLoginQueryIndex
{
    PLAYER_LOGIN_QUERY_LOADFROM,
    PLAYER_LOGIN_QUERY_LOADGROUP,
    PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES,
    PLAYER_LOGIN_QUERY_LOADAURAS,
    PLAYER_LOGIN_QUERY_LOADSPELLS,
    PLAYER_LOGIN_QUERY_LOADQUESTSTATUS,
    PLAYER_LOGIN_QUERY_LOADHONORCP,
    PLAYER_LOGIN_QUERY_LOADREPUTATION,
    PLAYER_LOGIN_QUERY_LOADINVENTORY,
    PLAYER_LOGIN_QUERY_LOADITEMLOOT,
    PLAYER_LOGIN_QUERY_LOADACTIONS,
    PLAYER_LOGIN_QUERY_LOADSOCIALLIST,
    PLAYER_LOGIN_QUERY_LOADHOMEBIND,
    PLAYER_LOGIN_QUERY_LOADSPELLCOOLDOWNS,
    PLAYER_LOGIN_QUERY_LOADGUILD,
    PLAYER_LOGIN_QUERY_LOADBGDATA,
    PLAYER_LOGIN_QUERY_LOADSKILLS,
    PLAYER_LOGIN_QUERY_LOADMAILS,
    PLAYER_LOGIN_QUERY_LOADMAILEDITEMS,

    MAX_PLAYER_LOGIN_QUERY
};

enum UnitBytes2_Flags
{
    UNIT_BYTE2_FLAG_UNK0 = 0x01,
    UNIT_BYTE2_FLAG_UNK1 = 0x02,
    UNIT_BYTE2_FLAG_UNK2 = 0x04,
    UNIT_BYTE2_FLAG_UNK3 = 0x08,
    UNIT_BYTE2_FLAG_AURAS = 0x10,                     // show positive auras as positive, and allow its dispel
    UNIT_BYTE2_FLAG_UNK5 = 0x20,
    UNIT_BYTE2_FLAG_UNK6 = 0x40,
    UNIT_BYTE2_FLAG_UNK7 = 0x80
};

#define MAX_EFFECT_INDEX 3

/**
 * These are the different possible powers that are available to us, they should
 * be fairly familiar if you've played WoW.
 */
enum Powers
{
    POWER_MANA = 0,         ///< The most common one, mobs usually have this or rage
    POWER_RAGE = 1,         ///< This is what warriors use to cast their spells
    POWER_FOCUS = 2,         ///< Used by hunters after Cataclysm (4.x)
    POWER_ENERGY = 3,         ///< Used by rouges to do their spells
    POWER_HAPPINESS = 4,         ///< Hunter's pet's happiness affect their damage
    MAX_POWERS = 5,
    POWER_ALL = 127,          // default for class? - need check for TBC
    POWER_HEALTH = 0xFFFFFFFE ///< Health, everyone has this (-2 as signed value)
};

#define MAX_POWERS                        5

enum AreaLockStatus
{
    AREA_LOCKSTATUS_OK = 0,
    AREA_LOCKSTATUS_UNKNOWN_ERROR = 1,
    AREA_LOCKSTATUS_LEVEL_NOT_EQUAL = 2,
    AREA_LOCKSTATUS_LEVEL_TOO_LOW = 3,
    AREA_LOCKSTATUS_LEVEL_TOO_HIGH = 4,
    AREA_LOCKSTATUS_RAID_LOCKED = 5,
    AREA_LOCKSTATUS_QUEST_NOT_COMPLETED = 6,
    AREA_LOCKSTATUS_MISSING_ITEM = 7,
    AREA_LOCKSTATUS_ZONE_IN_COMBAT = 8,
    AREA_LOCKSTATUS_INSTANCE_IS_FULL = 9,
    AREA_LOCKSTATUS_NOT_ALLOWED = 10,
    AREA_LOCKSTATUS_HAS_BIND = 11,
    AREA_LOCKSTATUS_WRONG_TEAM = 12,
    AREA_LOCKSTATUS_PVP_RANK = 100
};

enum Gender
{
    GENDER_MALE = 0,
    GENDER_FEMALE = 1,
    GENDER_NONE = 2
};

#define MAX_GENDER                       3

// Race value is index in ChrRaces.dbc
enum Races
{
    RACE_HUMAN = 1,
    RACE_ORC = 2,
    RACE_DWARF = 3,
    RACE_NIGHTELF = 4,
    RACE_UNDEAD = 5,
    RACE_TAUREN = 6,
    RACE_GNOME = 7,
    RACE_TROLL = 8,
    RACE_GOBLIN = 9,
};

// max+1 for player race
#define MAX_RACES         9

enum Stats
{
    STAT_STRENGTH = 0,
    STAT_AGILITY = 1,
    STAT_STAMINA = 2,
    STAT_INTELLECT = 3,
    STAT_SPIRIT = 4
};

#define MAX_STATS                        5

// Class value is index in ChrClasses.dbc
enum Classes
{
    CLASS_WARRIOR = 1,
    CLASS_PALADIN = 2,
    CLASS_HUNTER = 3,
    CLASS_ROGUE = 4,
    CLASS_PRIEST = 5,
    // CLASS_DEATH_KNIGHT  = 6,                             // not listed in DBC, will be in 3.0
    CLASS_SHAMAN = 7,
    CLASS_MAGE = 8,
    CLASS_WARLOCK = 9,
    // CLASS_UNK2       = 10,unused
    CLASS_DRUID = 11,
};

// max+1 for player class
#define MAX_CLASSES       12

#define CLASSMASK_ALL_PLAYABLE \
    ((1<<(CLASS_WARRIOR-1))|(1<<(CLASS_PALADIN-1))|(1<<(CLASS_HUNTER-1))| \
     (1<<(CLASS_ROGUE-1))  |(1<<(CLASS_PRIEST-1)) |(1<<(CLASS_SHAMAN-1))| \
     (1<<(CLASS_MAGE-1))   |(1<<(CLASS_WARLOCK-1))|(1<<(CLASS_DRUID-1))   )

#define CLASSMASK_ALL_CREATURES ((1<<(CLASS_WARRIOR-1)) | (1<<(CLASS_PALADIN-1)) | (1<<(CLASS_MAGE-1)) )
#define MAX_CREATURE_CLASS 3

enum SkillRangeType
{
    SKILL_RANGE_LANGUAGE,                                   // 300..300
    SKILL_RANGE_LEVEL,                                      // 1..max skill for level
    SKILL_RANGE_MONO,                                       // 1..1, grey monolite bar
    SKILL_RANGE_RANK,                                       // 1..skill for known rank
    SKILL_RANGE_NONE,                                       // 0..0 always
};

enum SkillCategory
{
    SKILL_CATEGORY_ATTRIBUTES = 5,
    SKILL_CATEGORY_WEAPON = 6,
    SKILL_CATEGORY_CLASS = 7,
    SKILL_CATEGORY_ARMOR = 8,
    SKILL_CATEGORY_SECONDARY = 9,                       // secondary professions
    SKILL_CATEGORY_LANGUAGES = 10,
    SKILL_CATEGORY_PROFESSION = 11,                      // primary professions
    SKILL_CATEGORY_GENERIC = 12
};

// Data from SpellLine.dbc (1.12.1 checked)
enum SkillType
{
    SKILL_NONE = 0,

    SKILL_FROST = 6,
    SKILL_FIRE = 8,
    SKILL_ARMS = 26,
    SKILL_COMBAT = 38,
    SKILL_SUBTLETY = 39,
    SKILL_POISONS = 40,
    SKILL_SWORDS = 43,
    SKILL_AXES = 44,
    SKILL_BOWS = 45,
    SKILL_GUNS = 46,
    SKILL_BEAST_MASTERY = 50,
    SKILL_SURVIVAL = 51,
    SKILL_MACES = 54,
    SKILL_2H_SWORDS = 55,
    SKILL_HOLY = 56,
    SKILL_SHADOW = 78,
    SKILL_DEFENSE = 95,
    SKILL_LANG_COMMON = 98,
    SKILL_RACIAL_DWARVEN = 101,
    SKILL_LANG_ORCISH = 109,
    SKILL_LANG_DWARVEN = 111,
    SKILL_LANG_DARNASSIAN = 113,
    SKILL_LANG_TAURAHE = 115,
    SKILL_DUAL_WIELD = 118,
    SKILL_RACIAL_TAUREN = 124,
    SKILL_ORC_RACIAL = 125,
    SKILL_RACIAL_NIGHT_ELF = 126,
    SKILL_FIRST_AID = 129,
    SKILL_FERAL_COMBAT = 134,
    SKILL_STAVES = 136,
    SKILL_LANG_THALASSIAN = 137,
    SKILL_LANG_DRACONIC = 138,
    SKILL_LANG_DEMON_TONGUE = 139,
    SKILL_LANG_TITAN = 140,
    SKILL_LANG_OLD_TONGUE = 141,
    SKILL_SURVIVAL2 = 142,
    SKILL_RIDING_HORSE = 148,
    SKILL_RIDING_WOLF = 149,
    SKILL_RIDING_TIGER = 150,
    SKILL_RIDING_RAM = 152,
    SKILL_SWIMING = 155,
    SKILL_2H_MACES = 160,
    SKILL_UNARMED = 162,
    SKILL_MARKSMANSHIP = 163,
    SKILL_BLACKSMITHING = 164,
    SKILL_LEATHERWORKING = 165,
    SKILL_ALCHEMY = 171,
    SKILL_2H_AXES = 172,
    SKILL_DAGGERS = 173,
    SKILL_THROWN = 176,
    SKILL_HERBALISM = 182,
    SKILL_GENERIC_DND = 183,
    SKILL_RETRIBUTION = 184,
    SKILL_COOKING = 185,
    SKILL_MINING = 186,
    SKILL_PET_IMP = 188,
    SKILL_PET_FELHUNTER = 189,
    SKILL_TAILORING = 197,
    SKILL_ENGINEERING = 202,
    SKILL_PET_SPIDER = 203,
    SKILL_PET_VOIDWALKER = 204,
    SKILL_PET_SUCCUBUS = 205,
    SKILL_PET_INFERNAL = 206,
    SKILL_PET_DOOMGUARD = 207,
    SKILL_PET_WOLF = 208,
    SKILL_PET_CAT = 209,
    SKILL_PET_BEAR = 210,
    SKILL_PET_BOAR = 211,
    SKILL_PET_CROCILISK = 212,
    SKILL_PET_CARRION_BIRD = 213,
    SKILL_PET_CRAB = 214,
    SKILL_PET_GORILLA = 215,
    SKILL_PET_RAPTOR = 217,
    SKILL_PET_TALLSTRIDER = 218,
    SKILL_RACIAL_UNDED = 220,
    SKILL_CROSSBOWS = 226,
    SKILL_WANDS = 228,
    SKILL_POLEARMS = 229,
    SKILL_PET_SCORPID = 236,
    SKILL_ARCANE = 237,
    SKILL_PET_TURTLE = 251,
    SKILL_ASSASSINATION = 253,
    SKILL_FURY = 256,
    SKILL_PROTECTION = 257,
    SKILL_BEAST_TRAINING = 261,
    SKILL_PROTECTION2 = 267,
    SKILL_PET_TALENTS = 270,
    SKILL_PLATE_MAIL = 293,
    SKILL_LANG_GNOMISH = 313,
    SKILL_LANG_TROLL = 315,
    SKILL_ENCHANTING = 333,
    SKILL_DEMONOLOGY = 354,
    SKILL_AFFLICTION = 355,
    SKILL_FISHING = 356,
    SKILL_ENHANCEMENT = 373,
    SKILL_RESTORATION = 374,
    SKILL_ELEMENTAL_COMBAT = 375,
    SKILL_SKINNING = 393,
    SKILL_MAIL = 413,
    SKILL_LEATHER = 414,
    SKILL_CLOTH = 415,
    SKILL_SHIELD = 433,
    SKILL_FIST_WEAPONS = 473,
    SKILL_RIDING_RAPTOR = 533,
    SKILL_RIDING_MECHANOSTRIDER = 553,
    SKILL_RIDING_UNDEAD_HORSE = 554,
    SKILL_RESTORATION2 = 573,
    SKILL_BALANCE = 574,
    SKILL_DESTRUCTION = 593,
    SKILL_HOLY2 = 594,
    SKILL_DISCIPLINE = 613,
    SKILL_LOCKPICKING = 633,
    SKILL_PET_BAT = 653,
    SKILL_PET_HYENA = 654,
    SKILL_PET_OWL = 655,
    SKILL_PET_WIND_SERPENT = 656,
    SKILL_LANG_GUTTERSPEAK = 673,
    SKILL_RIDING_KODO = 713,
    SKILL_RACIAL_TROLL = 733,
    SKILL_RACIAL_GNOME = 753,
    SKILL_RACIAL_HUMAN = 754,
    SKILL_PET_EVENT_RC = 758,
    SKILL_RIDING = 762,
};

#define MAX_SKILL_TYPE               763

enum SpellSchools
{
    /// Physical, Armor
    SPELL_SCHOOL_NORMAL = 0,
    SPELL_SCHOOL_HOLY = 1,
    SPELL_SCHOOL_FIRE = 2,
    SPELL_SCHOOL_NATURE = 3,
    SPELL_SCHOOL_FROST = 4,
    SPELL_SCHOOL_SHADOW = 5,
    SPELL_SCHOOL_ARCANE = 6
};

#define MAX_SPELL_SCHOOL                  7

// byte flags  value (UNIT_FIELD_BYTES_1,2) (SpellShapeshiftForm.dbc, checked for 1.12.1)
enum ShapeshiftForm
{
    FORM_NONE = 0x00,
    FORM_CAT = 0x01,
    FORM_TREE = 0x02,
    FORM_TRAVEL = 0x03,
    FORM_AQUA = 0x04,
    FORM_BEAR = 0x05,
    FORM_AMBIENT = 0x06,
    FORM_GHOUL = 0x07,
    FORM_DIREBEAR = 0x08,
    FORM_CREATUREBEAR = 0x0E,
    FORM_CREATURECAT = 0x0F,
    FORM_GHOSTWOLF = 0x10,
    FORM_BATTLESTANCE = 0x11,
    FORM_DEFENSIVESTANCE = 0x12,
    FORM_BERSERKERSTANCE = 0x13,
    FORM_SHADOW = 0x1C,
    FORM_STEALTH = 0x1E,
    FORM_MOONKIN = 0x1F,
    FORM_SPIRITOFREDEMPTION = 0x20
};

/**
 * The different types of attacks you can do with
 * weapons
 */
enum WeaponAttackType
{
    ///Main-hand weapon
    BASE_ATTACK = 0,
    ///Off-hand weapon
    OFF_ATTACK = 1,
    ///Ranged weapon, bow/wand etc.
    RANGED_ATTACK = 2
};

#define MAX_ATTACK  3

enum SpellCastResult
{
    SPELL_FAILED_AFFECTING_COMBAT = 0x00,
    SPELL_FAILED_ALREADY_AT_FULL_HEALTH = 0x01,
    SPELL_FAILED_ALREADY_AT_FULL_MANA = 0x02,
    SPELL_FAILED_ALREADY_BEING_TAMED = 0x03,
    SPELL_FAILED_ALREADY_HAVE_CHARM = 0x04,
    SPELL_FAILED_ALREADY_HAVE_SUMMON = 0x05,
    SPELL_FAILED_ALREADY_OPEN = 0x06,
    SPELL_FAILED_MORE_POWERFUL_SPELL_ACTIVE = 0x07,
    // SPELL_FAILED_AUTOTRACK_INTERRUPTED          = 0x08, old commented CAST_FAIL_FAILED = 8,-> 29
    SPELL_FAILED_BAD_IMPLICIT_TARGETS = 0x09,
    SPELL_FAILED_BAD_TARGETS = 0x0A,
    SPELL_FAILED_CANT_BE_CHARMED = 0x0B,
    SPELL_FAILED_CANT_BE_DISENCHANTED = 0x0C,
    SPELL_FAILED_CANT_BE_PROSPECTED = 0x0D,
    SPELL_FAILED_CANT_CAST_ON_TAPPED = 0x0E,
    SPELL_FAILED_CANT_DUEL_WHILE_INVISIBLE = 0x0F,
    SPELL_FAILED_CANT_DUEL_WHILE_STEALTHED = 0x10,
    SPELL_FAILED_CANT_TOO_CLOSE_TO_ENEMY = 0x11,
    SPELL_FAILED_CANT_DO_THAT_YET = 0x12,
    SPELL_FAILED_CASTER_DEAD = 0x13,
    SPELL_FAILED_CHARMED = 0x14,
    SPELL_FAILED_CHEST_IN_USE = 0x15,
    SPELL_FAILED_CONFUSED = 0x16,
    SPELL_FAILED_DONT_REPORT = 0x17,     // [-ZERO] need check
    SPELL_FAILED_EQUIPPED_ITEM = 0x18,
    SPELL_FAILED_EQUIPPED_ITEM_CLASS = 0x19,
    SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND = 0x1A,
    SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND = 0x1B,
    SPELL_FAILED_ERROR = 0x1C,
    SPELL_FAILED_FIZZLE = 0x1D,
    SPELL_FAILED_FLEEING = 0x1E,
    SPELL_FAILED_FOOD_LOWLEVEL = 0x1F,
    SPELL_FAILED_HIGHLEVEL = 0x20,
    // SPELL_FAILED_HUNGER_SATIATED                = 0x21,
    SPELL_FAILED_IMMUNE = 0x22,
    SPELL_FAILED_INTERRUPTED = 0x23,
    SPELL_FAILED_INTERRUPTED_COMBAT = 0x24,
    SPELL_FAILED_ITEM_ALREADY_ENCHANTED = 0x25,
    SPELL_FAILED_ITEM_GONE = 0x26,
    SPELL_FAILED_ENCHANT_NOT_EXISTING_ITEM = 0x27,
    SPELL_FAILED_ITEM_NOT_READY = 0x28,
    SPELL_FAILED_LEVEL_REQUIREMENT = 0x29,
    SPELL_FAILED_LINE_OF_SIGHT = 0x2A,
    SPELL_FAILED_LOWLEVEL = 0x2B,
    SPELL_FAILED_SKILL_NOT_HIGH_ENOUGH = 0x2C,
    SPELL_FAILED_MAINHAND_EMPTY = 0x2D,
    SPELL_FAILED_MOVING = 0x2E,
    SPELL_FAILED_NEED_AMMO = 0x2F,
    SPELL_FAILED_NEED_REQUIRES_SOMETHING = 0x30,
    SPELL_FAILED_NEED_EXOTIC_AMMO = 0x31,
    SPELL_FAILED_NOPATH = 0x32,
    SPELL_FAILED_NOT_BEHIND = 0x33,
    SPELL_FAILED_NOT_FISHABLE = 0x34,
    SPELL_FAILED_NOT_HERE = 0x35,
    SPELL_FAILED_NOT_INFRONT = 0x36,
    SPELL_FAILED_NOT_IN_CONTROL = 0x37,
    SPELL_FAILED_NOT_KNOWN = 0x38,
    SPELL_FAILED_NOT_MOUNTED = 0x39,
    SPELL_FAILED_NOT_ON_TAXI = 0x3A,
    SPELL_FAILED_NOT_ON_TRANSPORT = 0x3B,
    SPELL_FAILED_NOT_READY = 0x3C,
    SPELL_FAILED_NOT_SHAPESHIFT = 0x3D,
    SPELL_FAILED_NOT_STANDING = 0x3E,
    SPELL_FAILED_NOT_TRADEABLE = 0x3F,     // rogues trying "enchant" other's weapon with poison
    SPELL_FAILED_NOT_TRADING = 0x40,     // CAST_FAIL_CANT_ENCHANT_TRADE_ITEM
    SPELL_FAILED_NOT_UNSHEATHED = 0x41,     // yellow text
    SPELL_FAILED_NOT_WHILE_GHOST = 0x42,
    SPELL_FAILED_NO_AMMO = 0x43,
    SPELL_FAILED_NO_CHARGES_REMAIN = 0x44,
    SPELL_FAILED_NO_CHAMPION = 0x45,     // CAST_FAIL_NOT_SELECT
    SPELL_FAILED_NO_COMBO_POINTS = 0x46,
    SPELL_FAILED_NO_DUELING = 0x47,
    SPELL_FAILED_NO_ENDURANCE = 0x48,
    SPELL_FAILED_NO_FISH = 0x49,
    SPELL_FAILED_NO_ITEMS_WHILE_SHAPESHIFTED = 0x4A,
    SPELL_FAILED_NO_MOUNTS_ALLOWED = 0x4B,
    SPELL_FAILED_NO_PET = 0x4C,
    SPELL_FAILED_NO_POWER = 0x4D,     // CAST_FAIL_NOT_ENOUGH_MANA
    SPELL_FAILED_NOTHING_TO_DISPEL = 0x4E,
    SPELL_FAILED_NOTHING_TO_STEAL = 0x4F,
    SPELL_FAILED_ONLY_ABOVEWATER = 0x50,     // CAST_FAIL_CANT_USE_WHILE_SWIMMING
    SPELL_FAILED_ONLY_DAYTIME = 0x51,
    SPELL_FAILED_ONLY_INDOORS = 0x52,
    SPELL_FAILED_ONLY_MOUNTED = 0x53,
    SPELL_FAILED_ONLY_NIGHTTIME = 0x54,
    SPELL_FAILED_ONLY_OUTDOORS = 0x55,
    SPELL_FAILED_ONLY_SHAPESHIFT = 0x56,
    SPELL_FAILED_ONLY_STEALTHED = 0x57,
    SPELL_FAILED_ONLY_UNDERWATER = 0x58,     // CAST_FAIL_CAN_ONLY_USE_WHILE_SWIMMING
    SPELL_FAILED_OUT_OF_RANGE = 0x59,
    SPELL_FAILED_PACIFIED = 0x5A,
    SPELL_FAILED_POSSESSED = 0x5B,
    // SPELL_FAILED_REAGENTS                       = 0x5C, [-ZERO] not in 1.12
    SPELL_FAILED_REQUIRES_AREA = 0x5D,     // CAST_FAIL_YOU_NEED_TO_BE_IN_XXX
    SPELL_FAILED_REQUIRES_SPELL_FOCUS = 0x5E,     // CAST_FAIL_REQUIRES_XXX
    SPELL_FAILED_ROOTED = 0x5F,     // CAST_FAIL_UNABLE_TO_MOVE
    SPELL_FAILED_SILENCED = 0x60,
    SPELL_FAILED_SPELL_IN_PROGRESS = 0x61,
    SPELL_FAILED_SPELL_LEARNED = 0x62,
    SPELL_FAILED_SPELL_UNAVAILABLE = 0x63,
    SPELL_FAILED_STUNNED = 0x64,
    SPELL_FAILED_TARGETS_DEAD = 0x65,
    SPELL_FAILED_TARGET_AFFECTING_COMBAT = 0x66,
    SPELL_FAILED_TARGET_AURASTATE = 0x67,     // CAST_FAIL_CANT_DO_THAT_YET_2
    SPELL_FAILED_TARGET_DUELING = 0x68,
    SPELL_FAILED_TARGET_ENEMY = 0x69,
    SPELL_FAILED_TARGET_ENRAGED = 0x6A,     // CAST_FAIL_TARGET_IS_TOO_ENRAGED_TO_CHARM
    SPELL_FAILED_TARGET_FRIENDLY = 0x6B,
    SPELL_FAILED_TARGET_IN_COMBAT = 0x6C,
    SPELL_FAILED_TARGET_IS_PLAYER = 0x6D,
    SPELL_FAILED_TARGET_NOT_DEAD = 0x6E,
    SPELL_FAILED_TARGET_NOT_IN_PARTY = 0x6F,
    SPELL_FAILED_TARGET_NOT_LOOTED = 0x70,     // CAST_FAIL_CREATURE_MUST_BE_LOOTED_FIRST
    SPELL_FAILED_TARGET_NOT_PLAYER = 0x71,
    SPELL_FAILED_TARGET_NO_POCKETS = 0x72,     // CAST_FAIL_NOT_ITEM_TO_STEAL
    SPELL_FAILED_TARGET_NO_WEAPONS = 0x73,
    SPELL_FAILED_TARGET_UNSKINNABLE = 0x74,
    SPELL_FAILED_THIRST_SATIATED = 0x75,
    SPELL_FAILED_TOO_CLOSE = 0x76,
    SPELL_FAILED_TOO_MANY_OF_ITEM = 0x77,
    // SPELL_FAILED_TOTEMS                         = 0x78,  // [-ZERO] not in 1.12
    SPELL_FAILED_TRAINING_POINTS = 0x79,
    SPELL_FAILED_TRY_AGAIN = 0x7A,     // CAST_FAIL_FAILED_ATTEMPT
    SPELL_FAILED_UNIT_NOT_BEHIND = 0x7B,
    SPELL_FAILED_UNIT_NOT_INFRONT = 0x7C,
    SPELL_FAILED_WRONG_PET_FOOD = 0x7D,
    SPELL_FAILED_NOT_WHILE_FATIGUED = 0x7E,
    SPELL_FAILED_TARGET_NOT_IN_INSTANCE = 0x7F,     // CAST_FAIL_TARGET_MUST_BE_IN_THIS_INSTANCE
    SPELL_FAILED_NOT_WHILE_TRADING = 0x80,
    SPELL_FAILED_TARGET_NOT_IN_RAID = 0x81,
    SPELL_FAILED_DISENCHANT_WHILE_LOOTING = 0x82,
    SPELL_FAILED_PROSPECT_WHILE_LOOTING = 0x83,
    //  SPELL_FAILED_PROSPECT_NEED_MORE             = 0x85,
    SPELL_FAILED_TARGET_FREEFORALL = 0x85,
    SPELL_FAILED_NO_EDIBLE_CORPSES = 0x86,
    SPELL_FAILED_ONLY_BATTLEGROUNDS = 0x87,
    SPELL_FAILED_TARGET_NOT_GHOST = 0x88,
    SPELL_FAILED_TOO_MANY_SKILLS = 0x89,     // CAST_FAIL_YOUR_PET_CANT_LEARN_MORE_SKILLS
    SPELL_FAILED_CANT_USE_NEW_ITEM = 0x8A,
    SPELL_FAILED_WRONG_WEATHER = 0x8B,     // CAST_FAIL_CANT_DO_IN_THIS_WEATHER
    SPELL_FAILED_DAMAGE_IMMUNE = 0x8C,     // CAST_FAIL_CANT_DO_IN_IMMUNE
    SPELL_FAILED_PREVENTED_BY_MECHANIC = 0x8D,     // CAST_FAIL_CANT_DO_IN_XXX
    SPELL_FAILED_PLAY_TIME = 0x8E,     // CAST_FAIL_GAME_TIME_OVER
    SPELL_FAILED_REPUTATION = 0x8F,
    SPELL_FAILED_MIN_SKILL = 0x90,
    SPELL_FAILED_UNKNOWN = 0x91,

    SPELL_CAST_OK = 0xFF      // custom value, don't must be send to client
};

#define MAX_TALENT_RANK 5

#if 1
#define UI64LIT(N) N ## ULL
#endif

// used for creating values for respawn for example
#define MAKE_PAIR64(l, h)  unsigned long long( unsigned int(l) | ( unsigned long long(h) << 32 ) )
#define PAIR64_HIPART(x)   (unsigned int)((unsigned long long(x) >> 32) & UI64LIT(0x00000000FFFFFFFF))
#define PAIR64_LOPART(x)   (unsigned int)(unsigned long long(x)         & UI64LIT(0x00000000FFFFFFFF))

#define MAKE_PAIR32(l, h)  unsigned int( unsigned short(l) | ( unsigned int(h) << 16 ) )
#define PAIR32_HIPART(x)   (unsigned short)((unsigned int(x) >> 16) & 0x0000FFFF)
#define PAIR32_LOPART(x)   (unsigned short)(unsigned int(x)         & 0x0000FFFF)

static const int MAX_ITEM_PROTO_DAMAGES = 5;
static const int MAX_ITEM_PROTO_SPELLS = 5;
static const int MAX_ITEM_PROTO_STATS = 10;

#define EXPECTED_MANGOSD_CLIENT_BUILD        {5875, 6005, 6141, 0}
#define EXPECTED_MANGOSD_CLIENT_VERSION      "1.12.x"
